package com.ym.medical.service.impl;

import com.ym.core.utils.tkmybatis.BaseSVImpl;
import com.ym.medical.dao.DoctorGoodatDao;
import com.ym.medical.domain.entity.DoctorGoodatEntity;
import com.ym.medical.domain.param.DoctorGoodatUpdateParam;
import com.ym.medical.service.IDoctorGoodatSV;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 医生擅长Service业务层处理
 *
 * @author ym
 * @date 2020-08-21
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class DoctorGoodatSVImpl extends BaseSVImpl<DoctorGoodatEntity, DoctorGoodatDao> implements IDoctorGoodatSV {


	/**
	 * 新增医生擅长
	 *
	 * @param updateParam 医生擅长 新增参数
	 * @return 结果
	 */
	@Override
	public Long insertPC(DoctorGoodatUpdateParam updateParam) {
		DoctorGoodatEntity entity = updateParam.covert();
		this.insert(entity);
		return entity.getId();
	}

	/**
	 * 修改医生擅长
	 *
	 * @param updateParam 医生擅长 修改参数
	 * @return 结果
	 */
	@Override
	public int updateByIdPC(DoctorGoodatUpdateParam updateParam) {
		DoctorGoodatEntity entity = updateParam.covert();
		int result = this.updateById(entity);
		return result;
	}
}
